<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
    <input type="text" id="txt">
    <input type="button" value="禁用" onclick="f1();">
    <script>
    function f1() {
        var t = document.getElementById("txt");
        t.disabled = true; //禁用
    }
</script>
</body>

</html>